package iscript.coreFramework.data.datatree 
{
	import flash.utils.Dictionary;
	import iscript.coreFramework.data.datatable.DataTable;
	import iscript.coreFramework.util.GUID;
	public class DataTree 
	{
		
		public function DataTree() 
		{
		  _initialize();
		}
		
		private var _treeDataTable:DataTable;		
		private var _treeDataTableName = GUID.create();
		private var _rootNode:DataTreeNode;
		
		public function get Data():DataTable {
			return _treeDataTable;
			}
		 
		public function get Root():DataTreeNode{
			return _rootNode;
		}
		 
		public function get Name():String {
			return _treeDataTableName;
			}
		 
		private function _initialize():void {
			_treeDataTable = new DataTable(Vector.<String>(["id", "parentNodeId", "treeNode"]));
			_rootNode = new DataTreeNode();	
			_rootNode.treeData = _treeDataTable;
			var _rootData:Dictionary = new Dictionary();
			_rootData["id"] = _rootNode.Id;
			_rootData["parentNodeId"] = null;
			_rootData["treeNode"] = _rootNode;
			_treeDataTable.addRow(_rootData);
		}	
		
	}

}